{% extends 'base.html' %}
{% load staticfiles %}
{% block content %}


    <div class="container-fluid">  <!-- 开加一个container的目的是为了让整体布局居中 -->
        <!-- 开始 -->
        <div class="col-lg-6 col-md-4 col-sm-6 col-xs-6">
            <div class="row"><!-- 将要加入的略缩图放入row中 -->
                <!-- 第一张略缩图开始 -->
                {% for item in itemlist %}

                    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-6" style="height: 400px;">
                           
                        <div class="thumbnail">
                                  <a href="{{ item.coupon_share_url }}"><img src="{{ item.pict_url }}"
                                                                             class="img-responsive"
                                                                             style="width: 180px;height:180px">
                                 </a>
                            <div class="caption">
                                <table>
                                    <tr>
                                        <td>
                                            【商品标题】{{ item.title }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <a href="vip.html">【商品id】{{ item.seller_id }}</a>
                                            <button onclick="copyToClip({{ item.seller_id }})"> Copy</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            【原价】{{ item.zk_final_price }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            【优惠券价格】{{ item.coupon_amount }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            【佣金比率】{{ item.commission_rate }}
                                        </td>
                                    </tr>
                                </table>


                                     
                            </div>
                               
                        </div>
                         
                    </div>
                    <!-- 第一张略缩图结束 -->
                {% endfor %}

            </div>

        </div>
        <!-- 结束 -->
        <button onclick="copyToClip()"> Copy</button>

                <div class="col-lg-6 col-md-4 col-sm-6 col-xs-6">

                <div class="row">
                    {% if message %}
                        <div class="alert alert-warning">{{ message }}</div>
                    {% endif %}
                    <div class="col-md-4 col-md-offset-4">
                        <form class='form-login' action="{% url 'vip' %}" method="post" enctype="multipart/form-data">
                            {% csrf_token %}
                            <div class="form-group">
                                {{ getid.id.label }}
                                {{ getid.id }}
                            </div>

                            <button type="submit" class="btn btn-primary pull-right" id='sum'>上传</button>
                        </form>
                    </div>
                </div>



                <textarea id="editors" class="form-control" rows="33">
{#                {{ message }}#}
                    {% for i,o in abc %}
                        <p>{{ i }}</p>
                        <img class="center-block img-responsive" href="{{ o }}" src="{{ o }}" alt="123">
                    {% endfor %}
                </textarea>
                </div>




        </div>







{% endblock %}

{% block script %}
    <script type="text/javascript">
        /**
         * 复制内容到粘贴板
         * content : 需要复制的内容
         * message : 复制完后的提示，不传则默认提示"复制成功"
         */
        {#    <h1>点击复制通用功能</h1>#}
        {#    <a href="https://blog.csdn.net/sunnyzyq/article/details/85065022">参考链接</a>#}
        function copyToClip(content, message) {
            txt = document.getElementById('editors').value;
            alert(txt);
            aux = document.createElement("input");
            aux.setAttribute("value", content);
            document.body.appendChild(aux);
            aux.select();
            document.execCommand("copy");
            document.body.removeChild(aux);
            if (message = null) {
                alert("功");

            } else {
                        alert(message);
{#                window.location.href = "http://www.tbzhu.com/vip";#}


            }
        }
    </script>

{% endblock %}